package com.yixq.soa.service.user.controller;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yixq.soa.service.web.auth.UserRealm;
import com.yixq.soa.service.web.utils.BaseController;

@RestController
public class IndexController extends BaseController {
	int a=0;
	@RequestMapping(path="/user-realm",method=RequestMethod.POST)
	public Object userRealm(){
		Optional<UserRealm> realm = this.getUserRealm();
		Map<String,Object> map = new HashMap<>();
		a++;
		map.put("a", a);
		map.put("realm", realm);
		return map;
	}
	
	@RequestMapping(path="/hello",method=RequestMethod.GET)
	public Object index(){
		Map<String,Object> map = new HashMap<>();
		map.put("hello", "world");
		return map;
	}
}
